<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    //find
    const myArr = [1, 2, 3, 4, 8, 12];
    var v1 = myArr.find(value => value > 8);
    console.log(v1); //12

    /*通过数组下标取对应值*/
    var v2 = myArr.find((value, index, arr) => {

      return index == 1 ? value : index
    });
    console.log(v2); //8
  </script>
</body>

</html>